<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<%@include file="/comm/pub.inc"%>
		<script type="text/javascript" src="<%=contextPath %>/web/system/pub.js" ></script>
		<style type="text/css">
		    html, body{
		        margin:0;padding:0;border:0;width:100%;height:100%;overflow:hidden;
		    }    
	    </style>
	</head>
	<body>
		<div id="queryForm" >
			<div style="width:100%;" >
				<table class="input-table" >
					<tr>
						<td>维度名称：</td>
						<td><input style="width:100%;" class="mini-textbox" /> </td>
						<td>关联字段：</td>
						<td >
							<input class="mini-textbox" style="width:100%;" />
						</td>
						<td>显示字段：</td>
						<td><input class="mini-textbox" style="width:100%;" /></td>
						<td>数据来源：</td>
						<td><input class="mini-checkbox" text="表格或视图"  /></td>
					</tr>
					<tr>
						<td colspan=8 >
							<div class="mini-toolbar" style="border-bottom:0;height:20px;">
						        <table style="width:100%;" cellpadding="0" cellspacing="0">
						            <tr>
							            <td style="width:100%;height:20px;text-align: left;">
							                <a class="mini-button" iconCls="icon-save" plain="true" onclick="executeSql" >查询</a>
							            </td>
						            </tr>
						        </table>
						    </div>
						    <textarea id="textAreaSql" class="mini-textarea" style="width:100%;height:400px;" emptyText="输入SQL" ></textarea>
						</td>
					</tr>
				</table>
			</div>
		</div>
		<div id="sqlResultWin" class="mini-window" title="查询结果" style="width:1000px;height:400px;" showMaxButton="true"
    		showToolbar="false" showFooter="true" showModal="false" showCollapseButton="true"
    		allowResize="true" allowDrag="true" ></div>
	</body>
	<script type="text/javascript" >
		var ResultSql;
		function toSqlResultWin(url){
			mini.get('sqlResultWin').load(url);
			mini.get('sqlResultWin').set({expanded:true})
			if ($('#sqlResultWin')[0].style.display == 'none')
				mini.get('sqlResultWin').show();
		}
		function closeSqlResutWin(){
			mini.get('sqlResultWin').hide();
		}
		function executeSql(){
			ResultSql = mini.get('textAreaSql').getValue();
			toSqlResultWin(contextPath+"/web/report/dim-datagrid.jsp?sdf="+new Date());
		}
	</script>
</html>
